package ch.janotta.slawo.da.tables;

import ch.janotta.slawo.da.Ability;
import ch.janotta.slawo.da.Focus;
import ch.janotta.slawo.da.Talent;
import ch.janotta.slawo.da.modifier.AbilityIncreaseModifier;
import ch.janotta.slawo.da.modifier.AdditionalFocusModifier;
import ch.janotta.slawo.da.modifier.AdditionalTalentModifier;
import ch.janotta.slawo.da.modifier.Modifier;

public final class AvvarStartingModifiersTable extends BackgroundStartingModifiersTable {
  private static final Modifier[] MODIFIERS_RESULTS_TABLE = {
    new AbilityIncreaseModifier(Ability.Dexterity, 1),         // 2d6 ==  2
    new AdditionalFocusModifier(Focus.Gambling),               // 2d6 ==  3
    new AdditionalFocusModifier(Focus.Gambling),               // 2d6 ==  4
    new AdditionalFocusModifier(Focus.Swimming),               // 2d6 ==  5
    new AdditionalFocusModifier(Focus.Intimidation),           // 2d6 ==  6
    new AbilityIncreaseModifier(Ability.Communication, 1),     // 2d6 ==  7
    new AbilityIncreaseModifier(Ability.Communication, 1),     // 2d6 ==  8
    new AdditionalFocusModifier(Focus.Might),                  // 2d6 ==  9
    new AdditionalFocusModifier(Focus.Stamina),                // 2d6 == 10
    new AdditionalFocusModifier(Focus.Stamina),                // 2d6 == 11
    new AbilityIncreaseModifier(Ability.Constitution, 1),      // 2d6 == 12
  };

  private Modifier[] backgroundModifiers = new Modifier[] {
      new AbilityIncreaseModifier(Ability.Strength, 1),
      new AdditionalFocusModifier(pickOneRandomFocus(Focus.AnimalHandling, Focus.Climbing)),
      new AdditionalTalentModifier(Talent.Speak_Read_TradeTongue),
      getNonDuplicateRandomModifier(true),
      getNonDuplicateRandomModifier(false)
  };

  @Override
  public Modifier getTableResult(int index) {
    return MODIFIERS_RESULTS_TABLE[index];
  }

  @Override
  public Modifier[] getAllStartingModifiers() {
    return backgroundModifiers;
  }
}
